public class Helper { public static String print(String p) { System.out.print(p); return p; } public static String arr(int p[]) { int n; String r = ""; for (n = 0; n < p.length; n++) { r += p[n] + ", "; } return r; } public static String arr(String p[]) { int n; String r = ""; for (n = 0; n < p.length; n++) { r += p[n] + "\n"; } return r; } public static String indent(int length, String s) { while ( s.length() < length ) { s = " " + s; } return s; } public static String indent(int length, int s) { String text = s + ""; while ( text.length() < length ) { text = " " + text; } return text; } public static String indent(int length, double s) { // Vermeidet Gleitkommafehler, // schneidet stellen kleiner als // Cent-Beträge ab s = ( Math.floor(s * 100) / 100 ); // s = (double)(int)( s * 100 ) / 100; String text = s + ""; if ( (s * 100) % 10 == 0 ) { text += "0"; } while ( text.length() < length ) { text = " " + text; } return text; } }